forum

home / developersection / forums / remove selected rows from multi-column listview in c#

Remove selected rows from multi-column listView in C#

Anonymous User 9309 17-Jul-2013
Hi Developers! 

I have a listview with two columns and I'm using a context menu to allow users to remove selected rows. To remove the selected rows, I've tried with the following code but it doesn't work:

private void toolStripMenuItem1_Click(object sender, EventArgs e)

{

    listView1.SelectedItems.Clear();

}

I suspect this is because the listview has two columns, but I can't figure out a solution to remove selected rows. Removing all rows works with: listView1.Items.Clear();.

Thanks in Advance


c# c# 
Updated on 17-Jul-2013

I am a content writter !


Message
Can you answer this question?

Answer

1 Answers

Liked By